﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace dzs.Web.configinfo
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                       
        }

        		protected void btnSave_Click(object sender, EventArgs e)
		{
			
			string strErr="";
			if(!PageValidate.IsNumber(txttsgj.Text))
			{
				strErr+="推送供应计划时间格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txttsps.Text))
			{
				strErr+="推送配送计划时间格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtygyqs.Text))
			{
				strErr+="月供应计划起始时间格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtygyjs.Text))
			{
				strErr+="月供应计划结束时间格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtpsyqs.Text))
			{
				strErr+="配送月起始时间格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtpsyjs.Text))
			{
				strErr+="配送月结束时间格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtgybz.Text))
			{
				strErr+="供应班长计划分发日期格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtpsbz.Text))
			{
				strErr+="配送班长计划分发日期格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtzlbz.Text))
			{
				strErr+="质量班长计划分发日期格式错误！\\n";	
			}

			if(strErr!="")
			{
				MessageBox.Show(this,strErr);
				return;
			}
			int tsgj=int.Parse(this.txttsgj.Text);
			int tsps=int.Parse(this.txttsps.Text);
			int ygyqs=int.Parse(this.txtygyqs.Text);
			int ygyjs=int.Parse(this.txtygyjs.Text);
			int psyqs=int.Parse(this.txtpsyqs.Text);
			int psyjs=int.Parse(this.txtpsyjs.Text);
			int gybz=int.Parse(this.txtgybz.Text);
			int psbz=int.Parse(this.txtpsbz.Text);
			int zlbz=int.Parse(this.txtzlbz.Text);

			dzs.Model.configinfo model=new dzs.Model.configinfo();
			model.tsgj=tsgj;
			model.tsps=tsps;
			model.ygyqs=ygyqs;
			model.ygyjs=ygyjs;
			model.psyqs=psyqs;
			model.psyjs=psyjs;
			model.gybz=gybz;
			model.psbz=psbz;
			model.zlbz=zlbz;

			dzs.BLL.configinfo bll=new dzs.BLL.configinfo();
			bll.Add(model);
			Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功！","Add.aspx");

		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("List.aspx");
        }
    }
}
